<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>v-show</title>
</head>
<body>
    <div id="app">
        <button value="切换显示" @click="changeIsShow">切换显示</button>
        <img v-show="isShow" src="./res/2.jpg" alt="">
        <br>
        <input type="button" value="年龄累加" @click="addAge">
        <br>
        <span>{{age}}</span>
        <br>
        <img v-show="age>20" src="./res/3.jpg" alt="">
    </div>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <script>
        var app = new Vue({
            el:"#app",
            data:{
                isShow: true,
                age:17
            },
            methods: {
                changeIsShow:function(){
                    this.isShow = !this.isShow;
                },
                addAge:function(){
                    this.age ++;
                }
            }
        })

    </script>
</body>
</html>